package zoo.member.admin.pro.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.member.admin.pro.domain.AdminProductCommand;

public class AdminProductDaoImpl extends SqlSessionDaoSupport implements AdminProductDao{

	@Override
	public void insert(AdminProductCommand adminProduct) {
		getSqlSession().insert("insertPro", adminProduct);
	}

	@Override
	public int getProRowCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("selectProCount",map);
	}

	@Override
	public List<AdminProductCommand> prolist(Map<String, Object> map) {
		List<AdminProductCommand> prolist = getSqlSession().selectList("selectProList",map);
		return prolist;
	}

	@Override
	public AdminProductCommand selectProBoard(Integer p_code) {
		AdminProductCommand proCommand = (AdminProductCommand)getSqlSession().selectOne("selectProBoard", p_code);
		return proCommand;
	}

	@Override
	public void update(AdminProductCommand proCommand) {
		getSqlSession().update("updateProBoard", proCommand);
	}

	@Override
	public void deleteProBoard(int p_code) {
		getSqlSession().delete("deleteProBoard", p_code);
		
	}
}
